<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('收益历史列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>基金代码：</label>
                                <input type="text" name="code"/>
                            </li>
                            <li>
                                <label>基金名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>购买平台：</label>
                                <input type="text" name="pingtai"/>
                            </li>
                            <li>
                                <label>基金组合：</label>
                                <input type="text" name="zuhe"/>
                            </li>
                            <li>
                                <label>单位净值：</label>
                                <input type="text" name="jingzhi"/>
                            </li>
                            <li>
                                <label>涨跌幅：</label>
                                <input type="text" name="zhangfu"/>
                            </li>
                            <li>
                                <label>估值：</label>
                                <input type="text" name="guzhi"/>
                            </li>
                            <li>
                                <label>持有成本：</label>
                                <input type="text" name="cost"/>
                            </li>
                            <li>
                                <label>持有份额：</label>
                                <input type="text" name="fene"/>
                            </li>
                            <li>
                                <label>估值日期：</label>
                                <input type="text" name="guzhiriqi"/>
                            </li>
                            <li>
                                <label>总金额：</label>
                                <input type="text" name="jine"/>
                            </li>
                            <li>
                                <label>总盈亏：</label>
                                <input type="text" name="yingkui"/>
                            </li>
                            <li>
                                <label>总收益率：</label>
                                <input type="text" name="shouyilv"/>
                            </li>
                            <li>
                                <label>净值日期：</label>
                                <input type="text" class="time-input" placeholder="请选择日期" name="date"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="jijin:shouyi:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="jijin:shouyi:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="jijin:shouyi:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="jijin:shouyi:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('jijin:shouyi:edit')}]];
        var removeFlag = [[${@permission.hasPermi('jijin:shouyi:remove')}]];
        var prefix = ctx + "jijin/shouyi";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "收益历史",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'code',
                    title: '基金代码'
                },
                {
                    field: 'name',
                    title: '基金名称'
                },
                {
                    field: 'pingtai',
                    title: '购买平台'
                },
                {
                    field: 'zuhe',
                    title: '基金组合'
                },
                {
                    field: 'jingzhi',
                    title: '单位净值'
                },
                {
                    field: 'zhangfu',
                    title: '涨跌幅'
                },
                {
                    field: 'guzhi',
                    title: '估值'
                },
                {
                    field: 'cost',
                    title: '持有成本'
                },
                {
                    field: 'fene',
                    title: '持有份额'
                },
                {
                    field: 'guzhiriqi',
                    title: '估值日期'
                },
                {
                    field: 'jine',
                    title: '总金额'
                },
                {
                    field: 'yingkui',
                    title: '总盈亏'
                },
                {
                    field: 'shouyilv',
                    title: '总收益率'
                },
                {
                    field: 'date',
                    title: '净值日期'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>